<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // includes() 用于判断数组中是否包含指定元素，是则返回true否则返回false

       /* 
        需求：判断数组当中是否包含指定的元素
        */ 
        const array1 = [1,2,3,4,5,6];
        let isInclude = array1.includes(2);
        console.log(isInclude);//true

        /* 
            第一个参数：指定的值
            第二个参数：从指定的位置开始寻找
        */ 
        const array2 = ['aa','bb','cc'];
        let isInclude2 = array2.includes("aa",0);
        console.log(isInclude2);//true

    </script>
</head>
<body>
    
</body>
</html>